package xc.utils;

import java.util.Scanner;

public class GetNumber {
    public static int ToInt() {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();

        if (input.isEmpty()) {
            return -1;
        }
        try{
            return Integer.parseInt(input);
        }catch(NumberFormatException e){
            return -1;
        }
    }
}
